package com.bobbygu.server.simpleapp.mapper;

import com.bobbygu.server.simpleapp.model.VersionModel;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;


public interface CheckVersionMapper {
    @Select("select * from version where appName = #{appName}")
    VersionModel getVersionMsg(String appName);

    @Update("update version set minSupportVersion=#{minSupportVersion}," +
            "currentVersion=#{currentVersion}," +
            "versionName=#{versionName}," +
            "updateContent=#{updateContent} where appName=#{appName}")
    void updateVersionMsg(@Param("appName") String appName,
                          @Param("minSupportVersion") int minSupportVersion,
                          @Param("currentVersion") int currentVersion,
                          @Param("versionName") String versionName,
                          @Param("updateContent") String updateContent);

    @Update("update version set apkUrl=#{apkUrl} where appName=#{appName}")
    void updateApk(@Param("appName") String appName, @Param("apkUrl") String apkUrl);
}
